package gam.n1.achievement.n;

import gam.n1.achievement.iAchievement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.Supplier;

public class LongAchievement extends BaseAchievement<Long>{

    public LongAchievement(@NotNull Supplier<Long> initValue, @Nullable String name) {
        super(initValue, name);
    }

    @Override
    public Class<Long> t() {
        return Long.class;
    }

    @Override
    public void set(Long aLong) {
        $t = aLong >= Long.MAX_VALUE || aLong <= Long.MIN_VALUE ? 0 : aLong;
    }

    @Override
    public iAchievement<Long> copy() {
        return new LongAchievement(valueF,name);
    }
}
